package org.tc.product.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.tc.product.entity.Commoditys;

@Mapper
public interface CommoditysMapper {
    int deleteByPrimaryKey(Integer id);

    int insertCom(Commoditys record);

    Commoditys selectComById(@Param("id") Integer id);

    List<Commoditys> selectAll(@Param("firstResult") int firstResult, @Param("pageSize") int pageSize, @Param("storeid") Integer storeid,@Param("brand")String brand);

    List<Commoditys> selectBrand(@Param("classoneid")Integer classoneid,@Param("classtweid")Integer classtweid,@Param("classthreeid")Integer classthreeid);
    int updateByPrimaryKey(Commoditys record);

    int getComCount(@Param("storeid") Integer storeid, @Param("state") Integer state);

    int updcom(Commoditys commoditys);

    List<Commoditys> getAllCom(@Param("storeid") Integer storeid);

    //获取最后插入id
    int getLastId();

    //根据名称获取id
    Integer getIdByName(@Param("name") String name, @Param("storeid") Integer storeid);

    List<Commoditys> getComByClass(Commoditys record);

    int QuerytoSalea(@Param("id") Integer id,
                     @Param("storeid") Integer storeid);

    int UpdtoSalea(@Param("stock") Integer stock,
                   @Param("id") Integer id,
                   @Param("storeid") Integer storeid);

    int UpdtoPro(@Param("stock") Integer stock,
                 @Param("commid") Integer commid);

    /**
     * 根据分店首页展示销量高的会员商品
     * @param storeid
     * @return
     * 马帅琦
     */
    List<Commoditys> QueryMem(@Param("storeid") Integer storeid);


    /**
     * 根据分店展示所有会员商品
     * @param storeid
     * @return
     */
    List<Commoditys> QueryAllMem(@Param("storeid") Integer storeid);
}